package com.cr.business.service.impl;

import com.cr.business.domain.vo.ScoreRankingVo;
import com.cr.business.mapper.TbScoreRankingInfoMapper;
import com.cr.business.service.ITbScoreRankingInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class ITbScoreRankingInfoServiceImpl implements ITbScoreRankingInfoService {

    @Resource
    private TbScoreRankingInfoMapper tbScoreRankingInfoMapper;

    @Override
    public Map<String, Object> getData() {
        // A榜
        List<ScoreRankingVo> a = tbScoreRankingInfoMapper.selectList("a");
        // B榜
        List<ScoreRankingVo> b = tbScoreRankingInfoMapper.selectList("b");
        // C榜
        List<ScoreRankingVo> c = tbScoreRankingInfoMapper.selectList("c");

        // 返回结果
        Map<String, Object> result = new HashMap<>();
        result.put("a", a);
        result.put("b", b);
        result.put("c", c);
        return result;
    }
}
